/**
 * 
 */
package com.gragra.sampling.sequentialStructure;
/**
 * @author Christoph Teichmann
 * created Mar 24, 2013 5:54:56 PM
 * @version 0.1
 */
public enum ExtensionLevels implements ExtensionInformationLevel
{
	/**
	 * 
	 */
	PunctEnvTypeLevel 
	{
		@Override
		public ExtensionInformationValue[] getPossibleValues()
		{return PunctEnvType.values();}
		@Override
		public boolean isFinite()
		{return true;}
		@Override
		public ExtensionInformationValue getValueClass(String value)
		{return PunctEnvType.valueOf(value);}
	},
	/**
	 * 
	 */
	CaseTypeLevel
	{
		@Override
		public ExtensionInformationValue[] getPossibleValues()
		{return CaseLevel.values();}
		@Override
		public boolean isFinite()
		{return true;}
		@Override
		public ExtensionInformationValue getValueClass(String value)
		{return CaseLevel.valueOf(value);}
	},
	/**
	 * 
	 */
	WordTypeLevel
	{
		@Override
		public ExtensionInformationValue[] getPossibleValues()
		{return WordType.values();}
		@Override
		public boolean isFinite()
		{return true;}
		@Override
		public ExtensionInformationValue getValueClass(String value)
		{return WordType.valueOf(value);}
	},
	/**
	 * this uses -1 to indicate the absence of any tag
	 */
	ContextTagLevel
	{
		@Override
		public ExtensionInformationValue[] getPossibleValues()
		{return null;}
		@Override
		public boolean isFinite()
		{return false;}
		@Override
		public ExtensionInformationValue getValueClass(String value)
		{return null;}
	},
	/**
	 * this uses -1 to indicate the absence of any tag
	 */
	SimpleSuffixLevel
	{
		@Override
		public ExtensionInformationValue[] getPossibleValues()
		{return null;}
		@Override
		public boolean isFinite()
		{return false;}
		@Override
		public ExtensionInformationValue getValueClass(String value)
		{return null;}
	},
	/**
	 * 
	 */
	HyphenLevel
	{
		@Override
		public ExtensionInformationValue[] getPossibleValues()
		{return HyphenType.values();}
		@Override
		public boolean isFinite()
		{return true;}
		@Override
		public ExtensionInformationValue getValueClass(String value)
		{return HyphenType.valueOf(value);}
	},
	/**
	 * 
	 */
	NumericalLevel
	{
		@Override
		public ExtensionInformationValue[] getPossibleValues()
		{return NumericalType.values();}
		@Override
		public boolean isFinite()
		{return true;}
		@Override
		public ExtensionInformationValue getValueClass(String value)
		{return NumericalType.valueOf(value);}
	},
	/**
	 * 
	 */
	PunctuationLevel
	{
		@Override
		public ExtensionInformationValue[] getPossibleValues()
		{return PunctuationType.values();}
		@Override
		public boolean isFinite()
		{return true;}
		@Override
		public ExtensionInformationValue getValueClass(String value)
		{return PunctuationType.valueOf(value);}
	};
	/**
	 * 
	 */
	private int number = -1;
	/**
	 *
	 * @return
	 */
	public int getNumber()
	{
		if(number < 0)
		{
			for(int i=0;i<ExtensionLevels.values().length;++i)
			{
				if(ExtensionLevels.values()[i] == this)
				{return number = i;}
			}
		}
		return number;
	}
	/**
	 *
	 * @return
	 */
	public abstract ExtensionInformationValue getValueClass(String value);
}